<#assign tit><#if _oper='add'>新增<#else>修改</#if>用户</#assign>
<@page.html title=tit>
<script type="text/javascript" src="${_appPath!}/js/cal.js"></script>
<div style="width:800px;">

  <form id="fm_input" method="post" action="<#if _oper='add'>_add<#else>_edit</#if>" onsubmit="return post(this);">
    <div class="kbox">
      <div style="width:360px; float:left;">
        <table class="input">
          <tr>
            <th width="28%">编号</th>
            <td width="72%"><#if _oper='add'><input type="text" name="userCode" value="${user.userCode!}" req="编号" size="16" maxlength="20"><span class="require">*</span><#else><input type="hidden" name="userCode" value="${user.userCode!}">${user.userCode!}</#if></td>
          </tr>
          <tr>
            <th>登录密码</th>
            <td><input type="password" name="password" value=""<#if _oper='add'> req="登录密码"</#if> size="16" maxlength="20"><#if _oper='add'><span class="require">*</span><#else>(不改留空)</#if></td>
          </tr>
          <tr>
            <th>中文名</th>
            <td><input type="text" name="chName" value="${user.chName!}" req="中文名" size="26" maxlength="50"><span class="require">*</span></td>
          </tr>
          <tr>
            <th>英文名</th>
            <td><input type="text" name="enName" value="${user.enName!}" size="26" maxlength="50"></td>
          </tr>
          <tr>
            <th>权限组</th>
            <td><select name="groupCode"><option value="">无</option><#if userGroup??><#list userGroup as t><option value="${t.id}"<#if user.groupCode?? && user.groupCode=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
          </tr>
          <tr>
            <th nowrap>平板登录门店</th>
            <td><select name="deptCode"><option value="">无</option><#if shopList??><#list shopList as t><option value="${t.code}"<#if user.deptCode?? && user.deptCode=t.code> selected</#if>>${t.code} - ${t.chName}</option></#list></#if></select></td>
          </tr>
          <tr>
            <th>职务</th>
            <td><select name="userPosition"><option value="">无</option><#if userPosition??><#list userPosition as t><option value="${t.id}"<#if user.userPosition?? && user.userPosition=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
          </tr>
          <tr>
            <th>手机号</th>
            <td><input type="text" name="mobile" value="${user.mobile!}" size="20" maxlength="20"></td>
          </tr>
          <tr>
            <th>电话</th>
            <td><input type="text" name="phone" value="${user.phone!}" size="20" maxlength="20"></td>
          </tr>
          <tr>
            <th>性别</th>
            <td><select name="gender"><option value=""></option><#if gender??><#list gender as t><option value="${t.id}"<#if user.gender?? && user.gender=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
          </tr>
          <tr>
            <th>生日</th>
            <td><input type="text" class="date" name="birthday" value="${user.birthday!}" onclick="cal(this);" size="12" maxlength="10"></td>
          </tr>
          <tr>
            <th>工号</th>
            <td><input type="text" name="staffId" value="${user.staffId!}" size="12" maxlength="12"></td>
          </tr>
          <tr>
            <th>过期标记</th>
            <td><input type="radio" class="cb" name="expire" id="expire_0" value="0"<#if user.expire!=1> checked</#if>><label for="expire_0">正常</label>
              <input type="radio" class="cb" name="expire" id="expire_1" value="1"<#if user.expire=1> checked</#if>><label for="expire_1">过期</label></td>
          </tr>
          <tr>
            <th>过期时间</th>
            <td><input type="text" class="date" name="expireDate" value="${user.expireDate!}" onclick="cal(this);" size="12" maxlength="10"></td>
          </tr>
          <tr>
            <th>安全级别</th>
            <td><select name="secuityLevel"><#if secuityLevel??><#list secuityLevel as t><option value="${t.id}"<#if user.secuityLevel?? && user.secuityLevel=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
          </tr>
          <tr>
            <th>允许IP</th>
            <td><input type="text" name="allowIp" value="${user.allowIp!}"></td>
          </tr>
          <tr>
            <th>状态</th>
            <td><input type="radio" class="cb" name="status" id="enable_1" value="1"<#if user.status=1> checked</#if>><label for="enable_1">正常</label>
              <input type="radio" class="cb" name="status" id="enable_2" value="2"<#if user.status!=1> checked</#if>><label for="enable_2">禁用</label></td>
          </tr>
        </table>
      </div>
      <div style="width:350px; float:left; margin-left:10px;">
        <div class="lsinfo" style="margin-top:10px;">可登录门店
          <label style="margin-left:10px;"><input type="checkbox" name="loginAllShop" value="1"<#if user.loginAllShop?? && user.loginAllShop=1> checked</#if>>登录全部门店</label>
          <label style="margin-left:10px;"><input type="checkbox" name="loginSingle" value="1"<#if user.loginSingle?? && user.loginSingle=1> checked</#if>>只能单一登录</label></div>
        <table class="list">
          <tr>
            <th width="13%">选择</th>
            <th width="25%">编号</th>
            <th width="45%" class="left">名称</th>
            <th width="13%">默认</th>
            <th width="4%"></th>
          </tr>
        </table>
        <div style="height:310px; overflow-y:auto;">
          <table class="list">
            <#if shopList??><#list shopList as t>
            <tr<#if t_index%2==1> class="line2"<#else> class="line1"</#if>>
              <td width="14%" class="no"><input type="checkbox" class="cb" name="shops" value="${t.code}" <#if t.status?? && t.status=1> checked</#if>/></td>
              <td width="26%">${t.code}</td>
              <td width="47%" class="left">${t.chName}</td>
              <td width="14%"><input type="checkbox" class="cb" name="shopdf" value="${t.code}" <#if t.makeCard?? && t.makeCard=1> checked</#if>/></td>
            </tr></#list></#if>
          </table>
        </div>

        <div class="lsinfo">可查询区域
          <label style="margin-left:10px;"><input type="checkbox" name="queryAllShop" value="1"<#if user.queryAllShop?? && user.queryAllShop=1> checked</#if>>查询全部门店</label>
          <label style="margin-left:10px;"><input type="checkbox" name="queryOwnData" value="1"<#if user.queryOwnData?? && user.queryOwnData=1> checked</#if>>查询自己数据</label></div>
        <table class="list">
          <tr>
            <th width="13%">选择</th>
            <th width="30%">编号</th>
            <th width="45%" class="left">名称</th>
            <th width="4%"></th>
          </tr>
        </table>
        <div style="height:310px; overflow-y:auto;">
          <table class="list">
            <#if areaList??><#list areaList as t>
              <tr<#if t_index%2==1> class="line2"<#else> class="line1"</#if>>
                <td width="14%" class="no"><input type="checkbox" class="cb" name="areas" value="${t.code}" <#if t.status?? && t.status=1> checked</#if>/></td>
                <td width="32%">${t.code}</td>
                <td width="54%" class="left">${t.chName}</td>
              </tr></#list></#if>
          </table>
        </div>

      </div>
      <div class="clear"></div>
    </div>
    <div class="button"><input type="submit" value="提 交"></div>
  </form>
</div>
</@page.html>